class_name FighterStateAttack
extends StateBase


var unit: UnitFighter


func on_enter(owner = null, params = null):
	unit = owner as UnitFighter
	
	unit.melee_hit_targets = []
	
	unit.body_animation_player.play("attack")
	await unit.body_animation_player.animation_finished
	unit.states.transition("Approach")
	

func on_exit(owner = null):
	#unit.body_animation_player.play("idle")
	pass


func on_process(delta: float, owner = null):
	pass
	
	
func on_physics_process(delta: float, owner = null):
	unit.process_gravity(delta)
	unit.process_approach(delta)
	unit.process_face()
	unit.process_hit()
	unit.process_push_drop_item()
	
	unit.process_melee_hit()
	
